<include file="public/header" />
<body>
<div class="layui-fluid">
  <div class="layui-row">
    <form class="layui-form">
        <div class="layui-form-item">
          <label class="layui-form-label">角色名称<span style="color: red;">(必填)</span></label>
          <div class="layui-input-block">
            <input type="text" name="name"  style="width: 200px"  lay-verify="required"  value="" autocomplete="off" placeholder="" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述<span style="color: red;">(必填)</span></label>
            <div class="layui-input-block">
                <input type="text" name="desc"  style="width: 200px"    value="" autocomplete="off" placeholder="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">超级管理</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="1" title="是" checked="" >
                <input type="radio" name="type" value="0" title="否"  >
            </div>
        </div>
        <div class="layui-form-item" >
          <div class="layui-input-block">

            <button type="button"  class="layui-btn" lay-submit=""  lay-filter="addEdit">保存</button>
          </div>
        </div>
    </form>
  </div>
</div>
<script>

  layui.use(['form', 'layedit', 'laydate','jquery','upload'], function(){
      var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery

    //拖拽上传

    form.on('submit(addEdit)', function(data){
      $.post($('form').attr('action'),data.field,function(data){
        if(data.code == 200){
          layer.msg(data.msg);
          setTimeout(function () {
            window.history.back();
          },2000)
          xadmin.close();
          xadmin.father_reload();
        }else {
          layer.msg(data.msg);
        }
      });
      return false;
    });
  });

</script>
</body>

</html>
